/*
 * @lc app=leetcode.cn id=1791 lang=typescript
 *
 * [1791] 找出星型图的中心节点
 */

// @lc code=start
function findCenter(edges: number[][]): number {
    const one = edges[0];
    const two = edges[1];
    if (one[0] === two[0] || one[0] === two[1]) {
        return one[0];
    }
    if (one[1] === two[0] || one[1] === two[1]) {
        return one[1];
    }
    return -1;
}
// @lc code=end
